package com.javarush.test.level04.lesson16.home03;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Solution
{
    public static void main(String[] args)   throws Exception
    {
        //Напишите тут ваш код
        BufferedReader bufReader = new BufferedReader(new InputStreamReader(System.in));
        
        int summ = 0;
        while (true)
        {
            String sVallue = bufReader.readLine();
            int iVallue = Integer.parseInt(sVallue);

            if (iVallue == -1)
            {
                System.out.println(summ);
                break;
            }
            else 
            {
                summ = summ + iVallue;
                System.out.println(summ);
            }
            
        }
    }
}
